package com.elf.reactnative;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;

import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactNativeHost;

/**
 * 暂时不用，可以使用 {@link ReactNativeDelegate}可以兼容fragment
 */
@Deprecated
public class ReactActivityDelegateImpl extends ReactActivityDelegate {

    private ReactNativeHostImpl mReactNativeHostImpl;
    private String mJsBundleFile;

    public ReactActivityDelegateImpl(Activity activity, String jsBundleFile, @Nullable String mainComponentName) {
        super(activity, mainComponentName);
        mJsBundleFile = jsBundleFile;
    }

    @Nullable
    @Override
    protected Bundle getLaunchOptions() {
        return getPlainActivity().getIntent().getExtras();
    }

    @Override
    protected ReactNativeHost getReactNativeHost() {
        if (mReactNativeHostImpl == null) {
            mReactNativeHostImpl = new ReactNativeHostImpl(getPlainActivity().getApplication(), mJsBundleFile);
        }
        return mReactNativeHostImpl;
    }

    //-------继承修改可见性

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public void loadApp(String appKey) {
        super.loadApp(appKey);
    }

    @Override
    public void onPause() {
        super.onPause();
    }

    @Override
    public void onResume() {
        super.onResume();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }
}
